1. Field of the Invention
Embodiments of the present invention relate generally to computer graphics, and, more specifically, to a method of simulating clothing using long range attachments.
2. Description of the Related Art
Real-time computer simulations, which computer games employ, have gained mass popularity in recent times. One goal sought after by the computer game industry is to make games that provide a high level of realism for the game player. Computer game software is often written such that the game produces a lifelike game environment, and may include flowing water, cloth that billows in the wind and other realistic attributes. Creating such a game environment allows a player to become immersed in the game, and may allow the player to feel as if he/she is a character in the game world. A key problem in the game industry is that games often require a great deal of computer resources to produce realistic environments, and developers must balance that requirement with the limited computer resources that are available on a player's computer.
A significant difference between computer games and computer generated image (CGI) feature films such as Jurassic Park or Toy Story is that CGI films are not created in real time. In other words, each image or frame of a CGI film may take hours or days to develop, and may be created by a team of computer graphics engineers. In contrast, each frame of a real-time computer game must occur, by definition, in real time.
A common feature of both motion pictures and computer games is that they are made up of multiple frames that are shown at high speed, often at 23 to 26 frames per second. Operating at this frame rate or higher is required in order for the human eye to interpret a series of still-image frames as actual movement. If the frame rate drops substantially below this rate, a viewer may realize that he/she is viewing a series of still images. While both CGI films and computer games may project frames at high speed, CGI film creators have the luxury of producing a first frame without having to create a second frame almost immediately after the first frame. Computer game makers do not have this luxury, and write the underlying software of a computer game such that the computer game instructs a user's computer to produce a realistic image, and continue producing such images, in a fraction of a second. Furthermore, the computer must produce such images based on the player's interaction with the game. In other words, a computer game is designed to generate the game world in real time, as the player moves about in the game world and makes unique in-game choices. Each time a player interacts with a game, the game produces a unique series of images. This is in stark contrast to a CGI motion picture in which the order of images that make up the motion picture is static, and may not change based on a viewer's input.
Generating a game world in real time requires a large amount of computer resources. If the computer game software is inefficient, the software may cause the computer to produce frames slowly, at less than the desired frame rate. More specifically, the computer game may slow down or even “freeze.” As a general matter, a slow or frozen game is undesirable because it may cause a player to become frustrated and may reduce the sense of realism that the game imparts to the player. In addition, a game developer may choose to increase the realism of a game in order to make the game more competitive in the marketplace. However, such an increase in game realism often results in game software that requires a proportional increase in computer resources, which may not be available. Therefore, computer game software requires a delicate balance between creating as realistic a game environment as possible, using as few resources as possible, without allowing the computer game to slow down or freeze.
One aspect of computer games that adds to its realism is simulated cloth. Many games provide simulated cloth in the form of flags, tapestries, or clothing. Generating an image of cloth in the game world, however, may be challenging due to the fact that cloth has a distinct pattern of motion when force is applied to it. Cloth motion patterns are common in games, and may be seen when wind blows against a flag, or when a character walks, and the character's clothing trails in the character's wake. In the real world, these motion patterns are governed by the laws of physics. In the game world, motion patterns are produced by a game engine and are governed by game equations that reflect the movement of cloth in the real world.
A popular approach to generating motion patterns for cloth is the position based dynamics (PBD) algorithm. The PBD algorithm governs the movement of cloth in computer games. However, the PBD algorithm requires a large amount of computer resources in order to simulate realistic cloth movements. More specifically, a game engine using the PBD algorithm may require numerous iterations of the algorithm in order to realistically simulate cloth. As a consequence, a game engine using the PBD algorithm may require a large amount of computer resources in order to execute the desired number of iterations for real-time simulation. As a result, the conventional PBD algorithm is typically not efficient enough for simulating cloth movements in real-time.